﻿<%@ Page Language="C#" MasterPageFile="~/MuseumOwner.master" AutoEventWireup="true"
    CodeFile="ClueDetails.aspx.cs" Inherits="ClueDetails" Title="Clue Details" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/javascript">
        function MutExChkList(regex, current) {
            re = new RegExp(regex);
            for (i = 0; i < document.forms[0].elements.length; i++) {
                elm = document.forms[0].elements[i];
                if (elm.type == 'checkbox') {
                    if (re.test(elm.name)) {
                        elm.checked = false;
                    }
                }
                if (current.name == 'ctl00$ContentPlaceHolder1$chkIsHint1Answer')
                    document.getElementById("<%=txtAnswer.ClientID%>").value = document.getElementById("<%=txtHint1.ClientID%>").value;
                else if (current.name == 'ctl00$ContentPlaceHolder1$chkIsHint2Answer')
                    document.getElementById("<%=txtAnswer.ClientID%>").value = document.getElementById("<%=txtHint2.ClientID%>").value;
                else if (current.name == 'ctl00$ContentPlaceHolder1$chkIsHint3Answer')
                    document.getElementById("<%=txtAnswer.ClientID%>").value = document.getElementById("<%=txtHint3.ClientID%>").value;
                else if (current.name == 'ctl00$ContentPlaceHolder1$chkIsHint4Answer')
                    document.getElementById("<%=txtAnswer.ClientID%>").value = document.getElementById("<%=txtHint4.ClientID%>").value;
            }
            current.checked = true;
        }

        function Validate() {
            if (document.getElementById("<%=txtDirections.ClientID%>").value == "") {
                alert("Directions can not be blank.");
                document.getElementById("<%=txtDirections.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtFindArt.ClientID%>").value == "") {
                alert("Find Art can not be blank.");
                document.getElementById("<%=txtFindArt.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtFindWordAt.ClientID%>").value == "") {
                alert("Locate word can not be blank.");
                document.getElementById("<%=txtFindWordAt.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtAnswer.ClientID%>").value == "") {
                alert("Answer can not be blank.");
                document.getElementById("<%=txtAnswer.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtHint1.ClientID%>").value == "" && document.getElementById("<%=txtHint2.ClientID%>").value == "" &&
            document.getElementById("<%=txtHint3.ClientID%>").value == "" && document.getElementById("<%=txtHint4.ClientID%>").value == "") {
                alert("Enter at least one Hint details.");
                document.getElementById("<%=txtHint1.ClientID%>").focus();
                return false;
            }

            return true;
        }
    </script>

    <table width="100%" cellspacing="3" cellpadding="3" border="0">
        <tr>
            <td colspan="3" align="center">
                <b style="font-size: x-large;">Clue Details</b>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblMuseumName" Text="Museum" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlMuseum" runat="server" Width="200px" DataTextField="MuseumName"
                    DataValueField="MuseumID" AutoPostBack="true" CssClass="cmbBoxstyle" OnSelectedIndexChanged="ddlMuseum_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblGame" Text="Game" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlGame" runat="server" Width="200px" DataTextField="GameName"
                    DataValueField="GameID" AutoPostBack="true" OnSelectedIndexChanged="ddlGame_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblClueNumber" Text="Clue Number" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:DropDownList ID="ddlClueNumber" runat="server" Width="200px" OnSelectedIndexChanged="ddlClueNumber_SelectedIndexChanged"
                    AutoPostBack="true">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblAudioDirection" Text="Audio Direction" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <div style="float: left;">
                    <asp:FileUpload ID="fileAudioDirection" runat="server" Width="200px" MaxLength="1000">
                    </asp:FileUpload>
                &nbsp;&nbsp;&nbsp;<b style="color: red;">*</b>
                </div>
                <div style="vertical-align: super; padding-top: -3px;">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="txtAudioDirectionPath" runat="server" Wrap="true" ReadOnly="true"
                        TextMode="MultiLine" BorderStyle="None" BorderWidth="0" Width="200px" Rows="1"
                        Style="overflow: auto; resize: none;" />
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblDirections" Text="Directions" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtDirections" runat="server" Width="200px" TextMode="MultiLine"
                    Rows="4" MaxLength="2500">
                </asp:TextBox>
                &nbsp;<b style="color: red;">*</b>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblLocateArt" Text="Find Art" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtFindArt" runat="server" Width="200px" MaxLength="255">
                </asp:TextBox>
                &nbsp;<b style="color: red;">*</b>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblFindWordAt" Text="Locate Word" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtFindWordAt" runat="server" Width="200px" MaxLength="255">
                </asp:TextBox>
                &nbsp;<b style="color: red;">*</b>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblHint1" Text="Hint 1" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtHint1" runat="server" Width="200px" MaxLength="60">
                </asp:TextBox>&nbsp;&nbsp; Is Answer&nbsp;&nbsp;<input type="checkbox" id="chkIsHint1Answer"
                    checked="checked" runat="server" onclick="MutExChkList('chk',this);" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblHint2" Text="Hint 2" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtHint2" runat="server" Width="200px" MaxLength="60">
                </asp:TextBox>&nbsp;&nbsp; Is Answer&nbsp;&nbsp;<input type="checkbox" id="chkIsHint2Answer"
                    runat="server" onclick="MutExChkList('chk',this);" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblHint3" Text="Hint 3" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtHint3" runat="server" Width="200px" MaxLength="60">
                </asp:TextBox>&nbsp;&nbsp; Is Answer&nbsp;&nbsp;<input type="checkbox" id="chkIsHint3Answer"
                    runat="server" onclick="MutExChkList('chk',this);" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblHint4" Text="Hint 4" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtHint4" runat="server" Width="200px" MaxLength="60">
                </asp:TextBox>&nbsp;&nbsp; Is Answer&nbsp;&nbsp;<input type="checkbox" id="chkIsHint4Answer"
                    runat="server" onclick="MutExChkList('chk',this);" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lblAnswer" Text="Answer" runat="server"></asp:Label>
            </td>
            <td>
                :
            </td>
            <td>
                <div style="float: left;">
                    <asp:TextBox ID="txtAnswer" runat="server" Width="200px" MaxLength="250">
                    </asp:TextBox>
                    &nbsp;<b style="color: red;">*</b></div>
                &nbsp; &nbsp; &nbsp; <span style="vertical-align: middle">
                    <asp:CheckBox ID="chkIsCritical" runat="server" Width="200px" Text="Is Critical">
                    </asp:CheckBox></span> &nbsp; &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClick="btnSubmit_Click"
                    OnClientClick="return Validate();" />&nbsp;&nbsp;
                <asp:Button ID="btnReset" Text="Reset" runat="server" OnClick="btnReset_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <asp:Label ID="lblMessage" runat="server" ForeColor="Red" Visible="true"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
